﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace weba
{
    public partial class alluser : System.Web.UI.Page
    {
        sjklqDataContext sj = new sjklqDataContext();
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
              for (int i = 0; i < C1GridView1.Rows.Count;i++ )
            {
           CheckBox ck1=    C1GridView1.Rows[i].FindControl("CheckBox1") as CheckBox;
                if (ck1.Checked==true)
                {
              T_ServiceUser t =       sj.T_ServiceUser.Single(h=>h.T_ServiceID==int.Parse(ck1.Text.ToString()));
              t.T_PowerID = int.Parse(DropDownList1.SelectedItem.Value.ToString());
              sj.SubmitChanges();
              C1GridView1.DataBind();
                }
        }
    }
}}